<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="widget-block">
					<div class="widget-head">
						<h5><?php print $title?></h5>
					</div>
					<div class="widget-content">
            <div class="widget-searchbox">
              <ul>
                <li class="row-counts">Total Post: <span id='total_row_quotation'><?php print $total?></span></li>
                <li class="right">
                  <div class="input-prepend"> <span class="add-on"><i class="icon-search"></i></span>
                    <input type="text" id="cari" class="span2" value="<?php print $this->session->userdata("keuangan_mahasiswa_cari_mahasiswa_baru")?>">
                    <a href="javascript:void(0)" onclick="cari_manual()" class="btn btn-small">Search</a>
                    <a href="javascript:void(0)" onclick="clear_cari()" id="clear_cari" class="btn btn-small">Clear</a>
                  </div>
                </li>
              </ul>
            </div>
            <div class="widget-box">
              <table id="inti-quotation" class="table table-striped">
                <thead>
                  <tr>
                    <th>Ref Number</th>
                    <th><?php print lang("name")?></th>
                    <th>Jenis Tes</th>
                    <th>Submit</th>
                    <th>Biaya Form</th>
                    <th>Persyaratan Ujian</th>
                    <th>Hasil Ujian</th>
                    <th>Biaya Awal</th>
                    <th>Registrasi</th>
                    <th>Action</th>
                  </tr>
                </thead>
                <tbody id="ajax-body-quotation">
                </tbody>
              </table>
              <input type="text" value="create_date" id="field_simpan" style="display: none" />
              <input type="text" value="desc" id="sort_simpan" style="display: none" />
            </div>
          </div>
				</div>
			</div>
		</div>
  </div>
</div>

<script>
  function add_row_tambahan(table,url,act,param){
    var no = parseInt($('#'+param).val());
    $('#'+param).val(no+1);
    $.post(url,{no:$('#'+param).val(),action:act},function(data){
        $(data).clone(true).insertBefore("#"+table+" #"+act);
    });
  }
  function del_row_class(tr){
    $("."+tr).remove();
  }
  
  function clear_cari(){
    window.location = "<?php print site_url("keuangan-mahasiswa/mahasiswa-baru/nubusa-clear-search")?>";
  }
  function cari_manual(){
    window.location = "<?php print site_url("keuangan-mahasiswa/mahasiswa-baru")?>/"+$('#cari').val();
  }
  
  $(document).ready( function () {
    
    $("#cari").keypress(function(e){
      if(e.which == 13){
            window.location = "<?php print site_url("keuangan-mahasiswa/mahasiswa-baru")?>/"+$('#cari').val();
      }
    });
    
    del_row_class('ajax-quotation');
    add_row_tambahan('inti-quotation','<?php print site_url("keuangan-mahasiswa/ajax-mahasiswa-baru")?>/'+$('#total_row_quotation').text(),'ajax-body-quotation');
    $("th").removeClass();
    $("th").addClass("sorting");
    $("#create_date").removeClass("sorting");
    $("#create_date").addClass("sorting_desc");
  });
  function load_quotation(id){
    if(id == undefined){
      id = 0;
    }
    del_row_class('ajax-quotation');
    add_row_tambahan('inti-quotation','<?php print   site_url("keuangan-mahasiswa/ajax-mahasiswa-baru")?>/'+$('#total_row_quotation').text()+'/'+id,'ajax-body-quotation');
    return false;
  }
  
</script>